# Contributor: Andy Postnikov <apostnikov@gmail.com>
# Maintainer: Andy Postnikov <apostnikov@gmail.com>

pkgname=php8-pecl-pcov
_extname=pcov
pkgver=1.0.11
pkgrel=0
pkgdesc="Code coverage driver for PHP 8.0 - PECL"
url="https://pecl.php.net/package/pcov"
arch="all"
license="PHP-3.01"
depends="php8-common"
makedepends="php8-dev"
source="php-pecl-$_extname-$pkgver.tgz::https://pecl.php.net/get/$_extname-$pkgver.tgz"
builddir="$srcdir"/$_extname-$pkgver

build() {
	phpize8
	./configure --prefix=/usr --with-php-config=php-config8
	make
}

check() {
	php8 -dextension=modules/$_extname.so --ri $_extname
	make NO_INTERACTION=1 REPORT_EXIT_STATUS=1 test TESTS=--show-diff
}

package() {
	make INSTALL_ROOT="$pkgdir" install

	local _confdir="$pkgdir"/etc/php8/conf.d
	mkdir -p $_confdir
	echo "extension=$_extname" > $_confdir/$_extname.ini
}

sha512sums="
9d196d92ddfdcd22a69d94543202d861e8d54355991d528e7a5f5bb5423943d6bc04b1b9a117294b7337093765595e5be0ac95ab1619149ec6dc9d6a4a330d69  php-pecl-pcov-1.0.11.tgz
"
